<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="${base}/">
		<#include "/sys/common/sub_include.ftl">
		<script src="resources/js/sys/admin/admin_input.js"></script>
	</head>
	<body>
		<div class="container">
			<div class="col-md-1">
			</div>
			<div class="col-md-10">
				<div class="panel-input" >
								<div class="alert alert-warning alert-dismissible" role="alert">
									<button type="button" class="close" data-dismiss="alert" aria-label="Close" >
									<span aria-hidden="true">&times;</span>
									</button>
									<#if admin.id??>
									<strong>注意：</strong><span>密码留空则保持原密码</span>
									</#if>
								</div>
								<form method="get" class="form-horizontal" id="form0">
									<input type="hidden" class="form-control" name="id" value="${admin.id! }" />
									<input type="hidden" class="form-control" name="photo" value="${admin.photoId! }" />
									<div class="form-group">
										<label class="col-sm-2 control-label">头像</label>
										<div class="col-sm-10">
												<img id="previewImg" style="width:50;height:50" src="base/attachment/download/${admin.photoId!}" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label"></label>
										<div class="col-sm-10">
												<input class="form-control" id="previewBtn" name="file" type="file" class="filestyle" data-input="false">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">用户名</label>
										<div class="col-sm-10"><input type="text" class="form-control" name="username" value="${admin.username! }" required maxlength="128" /></div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">密码</label>
										<div class="col-sm-10"><input type="password" id="form0_password" class="form-control" name="password" <#if !admin.id??>required maxlength="16" </#if> /></div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">重复密码</label>
										<div class="col-sm-10"><input type="password" class="form-control" name="password2" equalTo="#form0_password" ></div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">名称</label>
										<div class="col-sm-10"><input type="text" class="form-control" name="name" value="${admin.name! }" required maxlength="128" /></div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">可用性</label>
										<div class="col-sm-10">
											<div class="form-control-static">
												<label>
													<#if admin.enabled >
													<input type="checkbox" name="enabled" checked value="true">可用
													<#else>
													<input type="checkbox" name="enabled" value="true">可用
													</#if>
												</label>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">角色</label>
										<div class="col-sm-10">
											<select id="roleList" class="form-control" name="roleIdList" multiple="multiple" required  >
												<#list roleList as role>
												<option value="${role.id}" <#if role.selected>selected</#if>  >${role.name}</option>
												</#list>
											</select>
										</div>
									</div>
									<div class="form-group">
										<div class="col-sm-4 col-sm-offset-2">
											<button class="btn btn-white" type="reset">撤销</button>
											<button class="btn btn-primary" type="submit">提交</button>
										</div>
									</div>
								</form>
				</div>
			</div>
			<div class="col-md-1">
			</div>
		<div>
	</body>
</html>